<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Lazy Loading of Widgets</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="../libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <script src="../libs/jquery/jquery.js"></script>
    <script src="../libs/bootstrap/js/bootstrap.min.js"></script>
    <script src="../dist/jquery.lazyloadxt.js"></script>
    <script src="../dist/jquery.lazyloadxt.widget.js"></script>
    <style>
        .placeholder {
            padding-bottom: 90%;
        }
        .g-plusone, .g-plus, .g-person {
            min-width: 100px;
            min-height: 50px;
        }
        .fb-like, .fb-share-button, .fb-post, .fb-comments {
            min-width: 86px;
            min-height: 20px;
        }
        .fb-post {
            min-height: 350px;
        }
        .fb-comments {
            min-height: 160px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="page-header">
        <h1>Lazy Loading of JavaScript Widgets</h1>
        <p class="lead">Lazy loading of Facebook, Twitter, and other widgets.</p>
    </div>

    <p>Note: some widgets don't work with file:// protocol.</p>
    <div class="placeholder">Scroll down to widgets...</div>

    <h3>Embedded Tweet (thank you, @Mortensen!)</h3>
    <div>
        <blockquote data-lazy-widget="twitter_1" class="twitter-tweet" lang="en"><p>Lazy load on steroids. On a horse. With rockets. <a href="https://t.co/2c3Se16JWh">https://t.co/2c3Se16JWh</a></p>&mdash; Mortensen (@Mortensen) <a href="https://twitter.com/Mortensen/statuses/414832111661887488">December 22, 2013</a></blockquote>
        <div id="twitter_1"><!--
        <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
        --></div>
    </div>

    <h3>Twitter Share Button</h3>
    <div>
        <a data-lazy-widget="twitter_2" href="https://twitter.com/share" class="twitter-share-button" data-size="large">Tweet</a>
        <div id="twitter_2"><!--
        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
        --></div>
    </div>

    <h3>Google+1 Button</h3>
    <div>
        <div data-lazy-widget="gp_1" class="g-plusone" data-annotation="inline" data-width="300"></div>
        <div id="gp_1"><!--
        <script type="text/javascript">
            (function() {
                var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                po.src = 'https://apis.google.com/js/platform.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
            })();
        </script>
        --></div>
    </div>

    <h3>Google+ Share Button</h3>
    <div>
        <div data-lazy-widget="gp_2" class="g-plus" data-action="share" data-height="24"></div>
        <div id="gp_2"><!--
        <script type="text/javascript">
            (function() {
                var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                po.src = 'https://apis.google.com/js/platform.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
            })();
        </script>
        --></div>
    </div>

    <h3>Google+ Badge</h3>
    <div>
        <div data-lazy-widget="gp_3" class="g-person" data-href="https://plus.google.com/108551811075711499995" data-rel="author"></div>
        <div id="gp_3"><!--
        <script type="text/javascript">
            (function() {
                var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                po.src = 'https://apis.google.com/js/platform.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
            })();
        </script>
        --></div>
    </div>

    <h3>Facebook Recommend Button</h3>
    <div>
        <div id="fb-root"></div>
        <div data-lazy-widget="fb_1" class="fb-like" data-href="http://ressio.github.io/lazy-load-xt" data-layout="button_count" data-action="recommend" data-show-faces="true" data-share="true"></div>
        <div id="fb_1"><!--
        <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        --></div>
    </div>

    <h3>Facebook Share Button</h3>
    <div>
        <div data-lazy-widget="fb_2" class="fb-share-button" data-href="http://ressio.github.io/lazy-load-xt" data-type="button_count"></div>
        <div id="fb_2"><!--
        <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        --></div>
    </div>

    <h3>Facebook Post</h3>
    <div>
        <div data-lazy-widget="fb_3" class="fb-post" data-href="https://www.facebook.com/jqueryscript/posts/589072127814625" data-width="500"></div>
        <div id="fb_3"><!--
        <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        --></div>
    </div>

    <h3>Facebook Comments</h3>
    <div>
        <div data-lazy-widget="fb_4" class="fb-comments" data-href="http://ressio.github.io/lazy-load-xt" data-numposts="5" data-colorscheme="light"></div>
        <div id="fb_4"><!--
        <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        --></div>
    </div>

</div>
</body>
</html>